<template>
  <el-dialog
      draggable
      v-model="PowerVisible"
      title="分配权限"
      width="600"
  >
    <el-table border lazy :data="PowerForm" style="width: 100%;">
      <el-table-column prop="roleName" label="角色名称" width=""/>
      <el-table-column prop="menuName" label="菜单权限" width=""/>
      <el-table-column prop="type" label="分配权限">
        <template #default="scope">
          <el-select size="small" v-model="scope.row.undock" placeholder="选择权限" style="width: 100px">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
          </el-select>
        </template>
      </el-table-column>
    </el-table>

    <template #footer>
      <div class="dialog-footer">
        <el-button size="large" @click="closeVisible">取消</el-button>
        <el-button size="large" type="primary" @click="onPower">确定</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import {defineProps} from 'vue'
import {defineModel} from 'vue'

const options = [
  {value: 0, label: '不具有',},
  {value: 1, label: '具有',},
]
const PowerVisible = defineModel('visible');
const PowerForm: Array<any> = defineModel('form');

interface Props {
  closeVisible?: Function;
  onPower?: Function;
}

defineProps<Props>();
</script>

<style scoped>

</style>